home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 49 / Amiga Format CD49 (2000-01-17)(Future Publishing)(GB)(Track 1 of 3)[!][issue 2000-02].iso / -websites- / whdload / games / harddrivin.lha / HardDrivin / Install < prev    next >
Text File  |  1999-02-17  |  3KB  |  164 lines

  1. ;****************************
  2.  
  3. (set #sub-dir "")        ;sub directory containing data files
  4. (set #readme-file "README")    ;name of readme file
  5. (set #cleanup "")        ;files to delete after install
  6.  
  7. ;****************************
  8.  
  9. ;----------------------------
  10. ; Checks if given program is reachable via the path
  11. ; if not abort install
  12. ; IN:  #program - to check
  13. ; OUT: -
  14.  
  15. (procedure P_chkrun
  16.   (if
  17.     (= 0 (run ("cd SYS:\nWhich %s" #program)))
  18.     ("")
  19.     (abort ("You must install \"%s\" first !\nIt must be accessible via the path.\nYou can find it in the whdload package." #program))
  20.   )
  21. )
  22.  
  23. ;----------------------------
  24. ; Wait for inserting disk
  25. ; IN:  #AD_disk - name of disk
  26. ; OUT: -
  27.  
  28. (procedure P_disk
  29.   (askdisk
  30.     (dest #AD_disk)
  31.     (prompt ("\nInsert Disk \"%s\" in any drive !" #AD_disk))
  32.     (help @askdisk-help)
  33.   )
  34. )
  35.  
  36. ;****************************
  37.  
  38. (if
  39.   (exists #readme-file)
  40.   (if 
  41.     (= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
  42.     ("")
  43.     (run ("SYS:Utilities/More %s" #readme-file))
  44.   )
  45. )
  46.  
  47. (set #program "WHDLoad")
  48. (P_chkrun)
  49.  
  50. (set @default-dest
  51.   (askdir
  52.     (prompt ("Where should \"%s\" installed ?\nA drawer \"%s\" will automatically created." @app-name @app-name))
  53.     (help @askdir-help)
  54.     (default @default-dest)
  55.     (disk)
  56.   )
  57. )
  58. (set #dest (tackon @default-dest @app-name))
  59. (if
  60.   (exists #dest)
  61.   (
  62.     (set #choice
  63.       (askbool
  64.         (prompt ("\nDirectory \"%s\" already exists.\n Should it be deleted ?" #dest))
  65.         (default 1)
  66.         (choices "Delete" "Skip")
  67.         (help @askbool-help)
  68.       )
  69.     )
  70.     (if
  71.       (= #choice 1)
  72.       (run ("Delete \"%s\" \"%s.info\" All" #dest #dest))
  73.     )
  74.   )
  75. )
  76. (makedir #dest
  77.   (help @makedir-help)
  78.   (infos)
  79. )
  80.  
  81. ;----------------------------
  82.  
  83. (copyfiles
  84.   (help @copyfiles-help)
  85.   (source ("%s.slave" @app-name))
  86.   (dest #dest)
  87. )
  88. (if
  89.   (exists ("%s.newicon" @app-name))
  90.   (set #icon
  91.     (askchoice
  92.       (prompt "\nWhich icon do you like to install ?\n")
  93.       (default 0)
  94.       (choices "Normal" "NewIcon")
  95.       (help @askchoice-help)
  96.     )
  97.   )
  98.   (set #icon 0)
  99. )
  100. (select #icon
  101.   (set #icon ("%s.inf" @app-name))
  102.   (set #icon ("%s.newicon" @app-name))
  103. )
  104. (copyfiles
  105.   (help @copyfiles-help)
  106.   (source #icon)
  107.   (newname ("%s.info" @app-name))
  108.   (dest #dest)
  109. )
  110. (if
  111.   (exists #readme-file)
  112.   (copyfiles
  113.     (help @copyfiles-help)
  114.     (source #readme-file)
  115.     (dest #dest)
  116.   )
  117. )
  118. (if
  119.   (exists ("%s.info" #readme-file))
  120.   (copyfiles
  121.     (help @copyfiles-help)
  122.     (source ("%s.info" #readme-file))
  123.     (dest #dest)
  124.   )
  125. )
  126. (if
  127.   (= #sub-dir "")
  128.   ("")
  129.   (
  130.     (set #dest (tackon #dest #sub-dir))
  131.     (makedir #dest
  132.       (help @makedir-help)
  133.     )
  134.   )
  135. )
  136. (copyfiles
  137.   (help @copyfiles-help)
  138.   (source ("OSEmu.400"))
  139.   (dest #dest)
  140. )
  141.  
  142. ;----------------------------
  143.  
  144. (set #AD_disk "harddrivin")
  145. (P_disk)
  146. (copyfiles
  147.   (help @copyfiles-help)
  148.   (source ("%s:" #AD_disk))
  149.   (dest #dest)
  150.   (pattern "~(c|l|s|.info|sys#?)")
  151. )
  152. (copyfiles
  153.   (help @copyfiles-help)
  154.   (source ("List"))
  155.   (dest #dest)
  156. )
  157.  
  158. ;----------------------------
  159.  
  160. (run ("Delete %s ALL QUIET FORCE" #cleanup))
  161.  
  162. (exit)
  163.  
  164.